<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="format-detection" content="telephone=no" />
    <link href="../../plugins/mui/mui.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="../../css/reset.css">
    <script src="../../js/statistics.js"></script>
    <title>兑换详情</title>
    <style>
        * {
            box-sizing: border-box;
            font-family: 'Microsoft YaHei';
            -webkit-tap-highlight-color:rgba(0,0,0,0);
        }
        body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, form, input, p, table, th, td, select, option {
            padding: 0;
            margin: 0;
            list-style: none;
        }
        body{

            border-bottom: 1px solid #e5e5e5;
        }
        header.header{
            background: #2a2c33;
            color: #ffffff;
        }
        .header h1{
            color:#fff;
            font-size:18px;
        }
        .header a{
            color:#fff;
        }
        .clearfix:before{
            display:table;
            content:'';
        }
        .clearfix:after{
            display:table;
            content:'';
            clear:both;
        }
        .top{
            height:55px;
            border-bottom: 1px dotted #e5e5e5;
            margin-left:10px;
            margin-right:10px;
        }
        .top>li{
            float:left;
            line-height: 55px;
            font-size: 14px;
            color:#666;
        }
        .top>li:last-child{
            color:#fc4f41;
            font-size: 24px;
            float:right;
        }
        .list{
            padding-bottom:10px;
            margin-left:10px;
            margin-right:10px;
        }
        .list>li{
            min-height:24px;
            padding-top:10px;
            line-height: 2;
        }
        .list>li:before{
            content: '';
            display: table;
            clear: both;
        }
        .list>li>span{
            float:left;
            max-width:20vw;
            font-size: 14px;
            color:#666;
            line-height: 14px;
        }
        .list>li>p{
            max-width:70vw;
            float: right;
            font-size: 14px;
            color:#333;
            line-height: 14px;
        }
    </style>
</head>
<body>
<header class="mui-bar mui-bar-nav header">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">兑换详情</h1>
</header>
<div class="mui-content">
    <ul class="top">
        <li>花费积分</li>
        <li class="use_score"></li>
    </ul>
    <ul class="list clearfix">
        <li>
            <span>商品名称</span>
            <p class="p_name"></p>
        </li>
        <li>
            <span>商品数量</span>
            <p class="p_num"></p>
        </li>
        <li>
            <span>当前状态</span>
            <p class="now_status"></p>
        </li>
        <li>
            <span>支付时间</span>
            <p class="pay_time"></p>
        </li>
        <li>
            <span>姓名</span>
            <p class="msg_name"></p>
        </li>
        <li>
            <span>电话</span>
            <p class="msg_phone"></p>
        </li>
        <li>
            <span>备注</span>
            <p class="msg_remark"></p>
        </li>
    </ul>
</div>
<script src='../../plugins/jquery/jquery-3.1.0.min.js'></script>
<script src="../../plugins/mui/mui.min.js"></script>
<script src="../../js/getApiToken.js"></script>
<script type="text/javascript" src="../../js/md5.js" ></script>
<script>
    mui.init();
    mui.plusReady(function(){
        var user_id = plus.storage.getItem('cg_user_id'),
                user_token = plus.storage.getItem('cg_user_token');
        var wait = plus.nativeUI.showWaiting('正在加载中...');
        var record_id=plus.webview.currentWebview().record_id;//列表id
        myAjax('exchange/exchangelist/recordinfo','post',{user_id:user_id,user_token:user_token,record_id:record_id},function(data){
            console.log(JSON.stringify(data));
            if(data.success){
//                $('.banner>.score>span').html(data.data.now+'/'+data.data.score)
                console.log(JSON.stringify(data));
                var detail=data.data[0];
                    $('.pay_time').html(time(detail.create_time));
                $(".now_status").html(detail.status);
                $(".p_num").html(detail.num);
                $(".p_name").html(detail.product_name);
                $(".use_score").html('-'+detail.content);
                $('.msg_name').html(detail.name);
                $('.msg_phone').html(detail.phone);
                $('.msg_remark').html(detail.remark);
                    wait.close();
            }else{
                wait.close();
                mui.alert("网络错误，请重新尝试");
            }
        });
    })
    function time(time) {
        var time=new Date(time*1000);
        return time.getFullYear()+'-'+(time.getMonth()+1)+'-'+time.getDate();
    }
</script>
</body>
</html>